package com.c611.smartclassroom.mapper.Ext;

import com.c611.smartclassroom.model.GateWay;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface GateWayMapperExt {

    @Insert("INSERT INTO t_gateway(gateWayID,tBuildID,gateWayMac,classroomID,acTime) " +
            "VALUE(#{newgateWay.gatewayid},#{buildId},#{newgateWay.gatewaymac},#{newgateWay.classroomid},#{newgateWay.actime})")
    void insertMySelective(@Param("newgateWay") GateWay newgateWay,@Param("buildId") String buildId);

    @Update("UPDATE t_gateway SET classroomID=#{newId} WHERE classroomID=#{oldId}")
    void updateClassRoomIdOther(@Param("newId") String newId,@Param("oldId") String oldId);
}
